package cz.muni.fi.pa165.sme.web.pages;

import cz.muni.fi.pa165.sme.web.fo.UserFO;
import cz.muni.fi.pa165.sme.web.panels.user.RegistrationForm;
import cz.muni.fi.pa165.sme.web.panels.user.UserForm;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.ResourceModel;

/** @author jirankova */
public class RegistrationPage extends TemplatePage {
	public RegistrationPage() {
		//page title
		add(new Label("title", new ResourceModel("registration.title")));

		//model of user's creation
		final CompoundPropertyModel<UserFO> model = new CompoundPropertyModel<UserFO>(new LoadableDetachableModel<UserFO>() {
			@Override
			protected UserFO load() {
				return new UserFO();
			}
		});


		//registration form - login and password
		add(new RegistrationForm("loginForm", model));
	}

	//	public UserAddPage() {
//		//page title
//		add(new Label("title", new ResourceModel("user.add.title")));
//
//		//model of user's creation
//		final CompoundPropertyModel<UserFO> model = new CompoundPropertyModel<UserFO>(new LoadableDetachableModel<UserFO>() {
//			@Override
//			protected UserFO load() {
//				return new UserFO();
//			}
//		});
//
//		//user creation form
//		add(new UserForm("form", model));
//	}
}
